package ru.papergames.model.binsocket.packets.request
{
	import ru.papergames.model.binsocket.data.ExtByteArray;
	import ru.papergames.model.binsocket.packets.SocketRequest;
	import ru.papergames.model.vo.PositionVO;
	

	public class BattleMoveBallRequest extends SocketRequest
	{
		public static const NOTIFICATION:String = 'BattleMoveBallRequest';
		
		public var path:Array;
		
		public function BattleMoveBallRequest(path:Array)
		{
			super(3);
			this.path = path;
		}
		
		override protected function getPacketBody():ExtByteArray {
			var body:ExtByteArray = new ExtByteArray();
			
			body.writeShort(path.length);
			
			for (var i:int = 0; i < path.length; i++) {
				var pos:PositionVO = path[i];
				body.writeShort(pos.x);
				body.writeShort(pos.y);
			}
			
			return body;
		}
		
		override public function getNotification():String {
			return NOTIFICATION;
		}
		
	}
}